package ${package};

import android.net.Uri;
<#list imports as import>
import ${import};
</#list>

/**
 * GENERATED CODE
 */
public class ${contractBaseName} {
	public static final String CONTENT_AUTHORITY = "${authority}";
	public static final Uri BASE_URI = Uri.parse("content://" + CONTENT_AUTHORITY);

	<#list db.entities as entity>
	interface ${entity.entityNamePlural}Columns {
		<#list entity.fields as field>
		/**
		 * Type: ${field.sqlType}<#if !field.nullable> NOT NULL</#if>
		 */
		String ${field.colName?upper_case} = "${field.colName}";

		</#list>
	}

	<#assign entityPlural = entity.entityNamePlural>
	<#assign entityPluralLower = entityPlural?lower_case>
	protected static class ${entityPlural}Base implements ${entityPlural}Columns {
		public static final String CONTENT_TYPE
				= "vnd.android.cursor.dir/vnd.${package}.${entityPluralLower}";
		public static final String CONTENT_ITEM_TYPE
				= "vnd.android.cursor.item/vnd.${package}.${entityPluralLower}";

		/**
		 * Matches: /${entityPluralLower}/
		 */
		public static Uri buildDirUri() {
			return BASE_URI.buildUpon().appendPath("${entityPluralLower}").build();
		}

		/**
		 * Matches: /${entityPluralLower}/[_id]/
		 */
		public static Uri buildItemUri(long _id) {
			return BASE_URI.buildUpon().appendPath("${entityPluralLower}").appendPath(Long.toString(_id)).build();
		}
	}

	</#list>
}
